﻿// 项目：	Guan.CMS.Web - Guan.CMS
// 文件名：	ViewModelToDomainMappingProfile.cs
// 
// 修改时间：2013-03-06 19:46
// 修改人：	Cooclsee

using AutoMapper;
using Guan.CMS.Domain.Commands.Account;
using Guan.CMS.Domain.Commands.Article;
using Guan.CMS.Domain.Commands.Contact;
using Guan.CMS.Domain.Commands.Product;
using Guan.CMS.Domain.Commands.ProductCategory;
using Guan.CMS.Domain.Commands.SiteConfig;
using Guan.CMS.Web.ViewModels;
using Guan.CMS.Web.ViewModels.Article;
using Guan.CMS.Web.ViewModels.Contact;
using Guan.CMS.Web.ViewModels.Page;
using Guan.CMS.Web.ViewModels.Product;
using Guan.CMS.Web.ViewModels.ProductCategory;

namespace Guan.CMS.Web.Mappers
{
    public class ViewModelToDomainMappingProfile : Profile
    {
        public override string ProfileName
        {
            get { return "ViewModelToDomainMappings"; }
        }

        protected override void Configure()
        {
            Mapper.CreateMap<SiteConfigFormModel, AddOrUpdateSiteConfigCommand>();
            Mapper.CreateMap<UserFormModel, UserRegisterCommand>();
            Mapper.CreateMap<ArticleFormModel, AddOrUpdateArticleCommand>();
            Mapper.CreateMap<AboutusViewModel, UpdateAboutUsPageCommand>();
            Mapper.CreateMap<ProductFormModel, AddOrUpdateProductCommand>();
            Mapper.CreateMap<ProductCategoryFormModel, AddOrUpdateProductCategoryCommand>();
            Mapper.CreateMap<ContactFormModel, AddContactCommand>();
        } 
    }
}